import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

public class MyTest {
    public static Epidemic epidemic;

    @BeforeAll
    public static void init() {
        System.out.println("初始化数据");
        epidemic = new Epidemic();
    }

    @Test
    void myTest1(){
        System.out.println("Test1: 2001~2500");
        for (int i = 2001; i <= 2500 ; i++) {
            epidemic.setEpidemicData(i);
            assertEquals(epidemic.Grade(),1);
        }
        System.out.println("Test1: Finish!");
    }

    @Test
    void myTest2(){
        System.out.println("Test2: 1301~2000");
        for (int i = 1301; i <= 2000 ; i++) {
            epidemic.setEpidemicData(i);
            assertEquals(epidemic.Grade(),2);
        }
        System.out.println("Test2: Finish!");
    }

    @Test
    void myTest3(){
        System.out.println("Test3: 801~1300");
        for (int i = 801; i <= 1300 ; i++) {
            epidemic.setEpidemicData(i);
            assertEquals(epidemic.Grade(),3);
        }
        System.out.println("Test3: Finish!");
    }

    @Test
    void myTest4(){
        System.out.println("Test4: 501~800");
        for (int i = 501; i <= 800 ; i++) {
            epidemic.setEpidemicData(i);
            assertEquals(epidemic.Grade(),4);
        }
        System.out.println("Test4: Finish!");
    }

    @Test
    void myTest5(){
        System.out.println("Test5: 201~500");
        for (int i = 201; i <= 500 ; i++) {
            epidemic.setEpidemicData(i);
            assertEquals(epidemic.Grade(),5);
        }
        System.out.println("Test5: Finish!");
    }

    @Test
    void myTest6(){
        System.out.println("Test6: 50~200");
        for (int i = 50; i <= 200 ; i++) {
            epidemic.setEpidemicData(i);
            assertEquals(epidemic.Grade(),6);
        }
        System.out.println("Test6: Finish!");
    }

    @Test
    void myTest7(){
        System.out.println("Test7: 1~49");
        for (int i = 1; i < 50 ; i++) {
            epidemic.setEpidemicData(i);
            assertEquals(epidemic.Grade(),7);
        }
        System.out.println("Test7: Finish!");
    }

    @AfterAll
    static void myTestExit(){
        System.out.println("测试完毕！");
    }

}
